import React, { useState } from 'react'
import { View, Text,Input } from '@tarojs/components'
import PageWrapper from '@/components/PageWrapper'
import SingleVideoUploader from '@/components/SingleVideoUploader/SingleVideoUploader'
import MultiImageUploader from '@/components/MultiImageUploader/MultiImageUploader'
import './index.scss';
const Page = () => {
  const [images, setImages] = useState<string[]>([])
  const [video, setVideo] = useState<string | null>(null)
  return (
    <PageWrapper title="发视频" showBack={true} backgroundColor='#F0F0F0'>
      <View className="sell-viedo-page">
        <View className="sell-viedo-upimg-box">
          <View className="viedo-title-item">上传视频</View>
          <View className="sell-viedo-up">
            <SingleVideoUploader
              value={video || ''}
              onChange={(url) => setVideo(url)}
            />
          </View>
          <View className="viedo-title-item top-20" >视频封面</View>
          <View className="sell-viedo-up">
            <MultiImageUploader
              maxCount={1}
              value={images}
              onChange={(newList) => setImages(newList)}
            />
          </View>
        </View>

        <View className="sell-viedo-msg-box">
          <View>
            <View className="viedo-title-item">视频标题</View>
            <Input className="viedo-title" placeholder="请输入">11</Input>
          </View>
          <View>
            <View className="viedo-title-item">注意事项</View>
            <View className="viedo-remark-item">1.上传视频:大小不大于1GB</View>
          </View>
        </View>

        <View className="submit-but">发布</View>
      </View>
    </PageWrapper>
  )
}

export default Page
